package net.njcp.mybatis.frame.constants;

/**
 * @ClassName JoinType
 * @Description: TODO
 * @Author 柳拓
 * @Date 2019/8/13
 * @Version V1.0
 **/
public enum JoinType {

    JOIN(1, "JOIN"),

    INNER_JOIN(2, "INNER_JOIN"),

    OUTER_JOIN(3, "OUTER_JOIN"),

    LEFT_OUTER_JOIN(4, "LEFT_OUTER_JOIN"),

    RIGHT_OUTER_JOIN(5, "RIGHT_OUTER_JOIN");

    private int value;

    private String name;

    JoinType(int value,String name){
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        // TODO Auto-generated method stub
        return value;
    }

    public String getName(){
        return name;
    }

    public static JoinType getJoinTypeByValue(int value){
        for(JoinType joinType : JoinType.values()){
            if(value == joinType.value){
                return joinType;
            }
        }
        return null;
    }
}
